<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <title>Other Page</title>
</head>

<body>
  <h1 id="banner">This is the nested document</h1>

  <script type="text/javascript">
    window.addEventListener("Message", receiveMessage.false);

    function receiveMessage(e) {
      if (e.origin == "http://titan") {
        displayMessage(e.data);
      } else {
        displayMessage("Message Discarded");
      }
    }

    function displayMessage(msg) {
      document.getElementById('banner').innerHTML = msg;
    }
  </script>
</body>

</html>
